function [ A ] = sid3( A, color, t )
%UNTITLED Summary of this function goes here
%   Detailed explanation goes here
    
    if exist([pwd,'/players/sid3'],'dir')
        display([pwd,'/players/sid3'])
        addpath(genpath([pwd,'/players/sid3']));
    end
    
    
    persistent startgame_depth;     startgame_depth = 2;
    persistent middlegame_depth;    middlegame_depth = 5;
    persistent endgame_depth;       endgame_depth = 13;
    
    
    % if time left < 40 seconds reduce middlegame_depth to x
    if t<80
        middlegame_depth = 4;
    end
    
    % test in which part of the game we are
    moves_left = length(find(A==0));
    
    
    % we are at the middle of the game
    if (moves_left < 52) && (moves_left > endgame_depth)
        [weight, A] = negaMAX(A, middlegame_depth, color, -inf, inf, 0);
        return;
    end
        
    
    % we are at the end of the game
    % evaluate stones only
    if moves_left < endgame_depth
        if t<20
            [weight, A] = negaMAX(A, endgame_depth-5, color, -inf, inf, 1);
        else
            [weight, A] = negaMAX(A, endgame_depth, color, -inf, inf, 1);
        end
        weight
        return;
    end
     
    
    % we are at the beginning of the game
        [weight, A] = negaMAX(A, startgame_depth, color, -inf, inf, 0);

    
end

